﻿<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        xmlns:ComponentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:winformchart="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"        
        xmlns:Properties="clr-namespace:VSLT_Reporting.Properties"
        xmlns:local="clr-namespace:VSLT_Reporting"
    xmlns:ReportingEngine="clr-namespace:ReportingEngine;assembly=ReportingEngine"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="VSLT_Reporting.MainWindow"
        Title="Visual Studio Load Test Reporting" Height="895" Width="1561" WindowStyle="ThreeDBorderWindow" Loaded="Window_Loaded" Closing="Window_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition x:Name="gridRibbonBarRow" Height="Auto"/>
            <RowDefinition x:Name="gridMainAppRow"/>
            <RowDefinition x:Name="gridStatusBarRow" Height="25" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition x:Name="gridMainWindowLeftSide" Width="{Binding GridSplitterWidthSetting, Mode=TwoWay, Source={x:Static Properties:Settings.Default}}"/>
            <ColumnDefinition x:Name="GridSplitter" Width="Auto"/>
            <ColumnDefinition x:Name="gridMainWindowRightSide"/>
        </Grid.ColumnDefinitions>
        <Ribbon Grid.Column="0" Grid.ColumnSpan="3" x:Name="RibbonWin"  SelectedIndex="1" >
            <Ribbon.HelpPaneContent>
                <RibbonMenuButton x:Name="mbHelp" SmallImageSource="Images/Help_16.png">
                    <RibbonMenuItem x:Name="btnMenuHelpTopic0" Header="Reporting Tool Help" Click="btnMenuHelpTopic0_Click" />
                    <RibbonSeparator Height="10"  />
                    <RibbonMenuItem x:Name="btnMenuHelpTopic1" Header="Why Results Differ" Click="btnMenuHelpTopic1_Click" />
                    <RibbonMenuItem x:Name="btnMenuHelpTopic2" Header="How Results Are Stored" Click="btnMenuHelpTopic2_Click" />
                    <RibbonMenuItem x:Name="btnMenuHelpTopic3" Header="All About Warmup and Cooldown" Click="btnMenuHelpTopic3_Click" />
                    <RibbonMenuItem x:Name="btnMenuHelpTopic4" Header="Help Topic 1" Click="btnMenuHelpTopic4_Click" IsEnabled="False" />
                </RibbonMenuButton>
            </Ribbon.HelpPaneContent>
            <Ribbon.ApplicationMenu>
                <!-- This is here and set to collapsed to keep the menu from showing-->
                <RibbonApplicationMenu Visibility="Collapsed" />
            </Ribbon.ApplicationMenu>
            <RibbonTab Header="Options" x:Name="RibbonTabOptions" KeyTip="O">
                <RibbonGroup x:Name="Configuration" Header="Configuration" >
                    <RibbonButton x:Name="btnOptionsSet" Label="Set Options" LargeImageSource="Images/Options_32.png" Click="btnOptionsSet_Click" 
						ToolTipDescription="Use this to set the various options available in the application" 
						ToolTipTitle="Set Options"  />
                    <RibbonButton x:Name="btnOptionsSave" Label="Save Options" LargeImageSource="Images/Options_32.png" Click="btnOptionsSave_Click" 
						ToolTipDescription="Use this to save changes you made to the options" 
						ToolTipTitle="Save Options" />
                    <RibbonButton x:Name="btnUpdateSqlCode" Label="Update Results DB" LargeImageSource="Images/Office_DB_Refresh_32.png" Click="btnUpdateSqlCode_Click" 
						ToolTipDescription="This will execute the code to add or update all the of SQL stored procedures and views to your load test database. It automatically removes any older versions that may be present." 
						ToolTipFooterDescription="This does NOT modify any of the core LoadTest2010 code or data and will NOT impact normal use of the DB by other applications" 
						ToolTipTitle="Database Update" ToolTipFooterTitle="PLEASE NOTE" />
                </RibbonGroup>
                <RibbonGroup x:Name="Debugging" Header="Debugging">
                    <RibbonButton x:Name="btnResetAppConfig" Label="Reset App Config" LargeImageSource="Images/AppConfig_Delete_32.png" Click="btnResetAppConfig_Click" 
						ToolTipDescription="This button is primarily for debugging purposes since I can't seem to always get the proper values to show up in the app.config." />
                </RibbonGroup>
                <RibbonGroup x:Name="SaveAndFormatGroup" Header="Reporting" Visibility="Visible">
                    <RibbonTwoLineText x:Name="tltFileNameForTemplate" Text="  Template File Name:" />
                    <RibbonTextBox x:Name="tbFileNameForTemplate" Text="Templates\FlowDocSample" TextBoxWidth="150"/>
                    <RibbonComboBox x:Name="cbTemplateFileType" Label="File Type" Height="22">
                        <RibbonGallery SelectedValue=".xaml" SelectedValuePath="Content" MaxColumnCount="1">
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content=".rtf" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content=".xaml" HorizontalAlignment="Left" />
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                    <RibbonButton x:Name="btnLoadRunResults" Label="Load Template" LargeImageSource="Images/LoadTestView_32.png" Click="btnLoadRunResults_Click" />
                    <RibbonButton x:Name="btnSaveRunResults" Label="Save Template" LargeImageSource="Images/LoadTest_Save_32.png" Click="btnSaveRunResults_Click" ToolTip="Not Yet Implemented"/>
                </RibbonGroup>
                <RibbonGroup x:Name="ApplicationStuff" Header="App">
                    <RibbonButton x:Name="btnDatabaseInformation" Label="Database Information" LargeImageSource="Images/Database_32.png" Click="btnDatabaseInformation_Click" ToolTip="Gathers a report of the settings, configuration and status of the LoadTest Database and the machine the DB is hosted on. " ToolTipFooterDescription="This report does require the user to have permission to query the 'master' DB" />
                </RibbonGroup>
            </RibbonTab>
            <RibbonTab Header="Home" x:Name="RibbonTabHome" KeyTip="H" >
                <RibbonGroup x:Name="RunsGroup" Header="Runs">
                    <RibbonButton x:Name="btnExit" Label="Exit" LargeImageSource="Images/Close_32.png" Click="btnExit_Click" Uid="btnExit_23" />
                    <RibbonButton x:Name="btnGetRuns" Label="Get All Runs" LargeImageSource="Images/LoadTest_32.png" Click="btnGetRuns_Click" IsEnabled="False" />
                </RibbonGroup>
                <RibbonGroup x:Name="InfoGroup" Header="Run Info">
                    <RibbonButton x:Name="btnShowRunResults" Label="Summary Results" LargeImageSource="Images/LoadTest_Scorecard_32.png" IsEnabled="false" Click="btnShowRunResults_Click" ToolTip="Show the core results and summary of the run in the FlowDocument window"/>
                    <RibbonButton x:Name="btnShowLoadTest" Label="Scenario-Run Info" LargeImageSource="Images/LoadTestView_32.png" IsEnabled="false" Click="btnShowLoadTest_Click" ToolTip="Show the Run Settings and Scenario Info in the FlowDocument window"/>
                    <RibbonButton x:Name="btnShowAnalysisNotes" Label="Analysis Notes" IsEnabled="False" LargeImageSource="Images/AnalysisNotes_32.png" Click="btnShowAnalysisNotes_Click" />
                    <RibbonButton x:Name="btnSaveLoadTestFile" Label="Save Load Test" IsEnabled="False" LargeImageSource="Images/XML_File_32.png" ToolTip="Saves the Load Test as an XML file" Click="btnSaveLoadTestFile_Click" />
                </RibbonGroup>
                <RibbonGroup x:Name="ReportGroup" Header="Reporting">
                    <RibbonButton x:Name="btnGenerateReport" Label="Build Report" IsEnabled="False" LargeImageSource="Images/Report_32.png" Click="btnGenerateReport_Click" />
                    <RibbonButton x:Name="btnPrintReport" Label="Print Report" IsEnabled="False" LargeImageSource="Images/Report_Print_32.png" Click="btnPrintReport_Click" />
                    <RibbonButton x:Name="btnSaveReport" Label="Save Report" LargeImageSource="Images/Report_Save_32.png" Click="btnSaveReport_Click" IsEnabled="False" />
                    <RibbonButton x:Name="btnAddTestIntervalTablesToReportTab" Label="Add Test Intervals" Visibility="Visible" LargeImageSource="Images/TestIntervals_32.png" IsEnabled="False" Click="btnAddTestIntervalTablesToReportTab_Click" />
                    <RibbonButton x:Name="btnAddTransIntervalTablesToReportTab" Label="Add Trans Intervals" Visibility="Visible" LargeImageSource="Images/TransactionIntervals_32.png" IsEnabled="False" Click="btnAddTransIntervalTablesToReportTab_Click" />
                    <RibbonButton x:Name="btnAddPageIntervalTablesToReportTab" Label="Add Page Intervals" Visibility="Visible" LargeImageSource="Images/PageIntervals_32.png" IsEnabled="False" Click="btnAddPageIntervalTablesToReportTab_Click" />
                    <RibbonButton x:Name="btnAddPerfmonIntervalTablesToReportTab" Label="Add Perf Intervals" Visibility="Visible" IsEnabled="False" LargeImageSource="Images/PerfmonIntervals_32.png" Click="btnAddPerfmonIntervalTablesToReportTab_Click" />
                </RibbonGroup>
                <RibbonGroup x:Name="ScoreCardGroup" Header="ScoreCard" >
                    <RibbonButton x:Name="btnGetScorecard" Label="Scorecard" LargeImageSource="Images/Scorecard_32.png" IsEnabled="False" ToolTipDescription="Creates a scorecard in Excel comparing various attributes between diferent runs." ToolTipTitle="Not Yet Implemented" Click="btnGetScorecard_Click" HorizontalAlignment="Left"/>
                    <RibbonCheckBox x:Name="cbUsePerfmonForScorecard" IsChecked="True" IsEnabled="True" Visibility="Collapsed" Label="Use Perf Counters" ToolTipDescription="Use perfmon counter values to build the scorecards"/>
                </RibbonGroup>
                <RibbonGroup x:Name="RunSummaryReportsByFilterGroup" Header="Runs By Column Filter" HorizontalAlignment="Right" Visibility="Collapsed">
                    <RibbonButton x:Name="btnGenerateFiltered" Label="Get Runs Filtered" LargeImageSource="Images/LoadTestFiltered_32.png" Click="btnGenerateFiltered_Click" IsEnabled="False" />
                    <RibbonComboBox x:Name="cbNameFilter" Label="Column" Height="22" SelectionBoxWidth="100">
                        <RibbonGallery x:Name="cbNameFilterSelectedValue" SelectedValue="LoadTestName" SelectedValuePath="Content" MaxColumnCount="1">
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content="LoadTestName" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Description" HorizontalAlignment="Left" />
                                <!--<RibbonGalleryItem Content="Run Duration" HorizontalAlignment="Left" />-->
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                    <RibbonComboBox x:Name="cbComparisonAdjective" Label="Adjective " Height="22" HorizontalAlignment="Right">
                        <RibbonGallery x:Name="cbComparisonAdjectiveSelectedValue" SelectedValue="=" SelectedValuePath="Content" MaxColumnCount="1">
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content="=" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="!=" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="LIKE" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="NOT LIKE" HorizontalAlignment="Left" />
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                    <RibbonTextBox x:Name="tbComparisonPhrase" Label="Phrase" Text="" Height="22" TextBoxWidth="125" />
                </RibbonGroup>
                <RibbonGroup x:Name="RunSummaryReportsByDateGroup" Header="Runs By Highlighted Date(s)" d:IsHidden="True">
                    <RibbonButton x:Name="btnToday" LargeImageSource="Images/Office_Calendar_Today_32.png" Label="Today" Click="btnToday_Click" />
                    <RibbonButton x:Name="btnHighlightedDay" LargeImageSource="Images/Office_Calendar_Day_32.png" Label="Highlighted Day" Click="btnHighlighted_Click" IsEnabled="False" />
                    <RibbonButton x:Name="btnHighlightedRange" LargeImageSource="Images/Office_Calendar_Days_32.png" Label="Highlighted Range" Click="btnHighlightedRange_Click" IsEnabled="False" />
                    <!--<RibbonButton x:Name="btnSelectedRuns" LargeImageSource="Images/Office_Calendar_Schedule_32.png" Label="Selected Runs" ToolTipDescription="Build the run report using only the highlighted runs in the run list" ToolTipTitle="Selected Runs Only" Click="btnSelectedRuns_Click" IsEnabled="False" />-->
                </RibbonGroup>
            </RibbonTab>
            <RibbonTab Header="Queries" x:Name="RibbonTabQueries" KeyTip="H" >
                <RibbonGroup x:Name="QueryGroup" Header="Specific Report Items">
                    <RibbonButton x:Name="btnQuery1" Label="Page Heatmap" LargeImageSource="Images/Office_Table_32.png" IsEnabled="true" ToolTip="Show the core results and summary of the run in the FlowDocument window" Click="btnQuery1_Click"/>
                    <RibbonButton x:Name="btnQuery2" Label="Throughput Heatmap" LargeImageSource="Images/Office_Table_32.png" IsEnabled="false" ToolTip="Show the Run Settings and Scenario Info in the FlowDocument window"/>
                    <RibbonButton x:Name="btnQuery3" Label="Page Chart" IsEnabled="false" LargeImageSource="Images/Office_Chart_Line_32.png" />
                </RibbonGroup>
                <RibbonGroup x:Name="ColumnsGroup" Header="Column To Plot With">
                    <RibbonComboBox x:Name="cbQueryColumn" Label="" IsEnabled="true">
                        <RibbonGallery x:Name="queryColumnSelectedValue" SelectedValue="Average" SelectedValuePath="Content" MaxColumnCount="1">
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content="Quantity" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Minimum" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Average" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Maximum" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="90Percent" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="95Percent" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Throughput" HorizontalAlignment="Left" />
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                </RibbonGroup>
            </RibbonTab>
            <RibbonTab Header="Tables" x:Name="RibbonTabTables" KeyTip="T">
                <RibbonGroup x:Name="tqrSingleRunGroup" Header="Settings" Visibility="Collapsed">
                    <RibbonToggleButton x:Name="btnToggleIncludeFailed" Label="Include Failed Iterations?" IsChecked="False" IsEnabled="False" Click="srIncludeFailed_Click"/>
                    <RibbonToggleButton x:Name="btnToggleIncludeWarmup" Label="Include Warmup/Cooldown?" IsChecked="False" IsEnabled="False" />
                    <RibbonToggleButton x:Name="btnToggleCombineNames" Label="Combine results for same name?" IsChecked="False" Click="srCombineNames_Click" IsEnabled="False" />
                </RibbonGroup>
                <RibbonGroup Header="Generate Table" LargeImageSource="Images/WebPerfmon_16.png">
                    <RibbonButton x:Name="btnGenTest" LargeImageSource="Images/WebTest_32.png" Label="Test Timings" IsEnabled="False" Click="srGenTest_Click" />
                    <RibbonButton x:Name="btnGenTransaction" LargeImageSource="Images/WebTransaction_16.png" Label="Transaction Timings" IsEnabled="False" Click="srGenTransaction_Click" />
                    <RibbonButton x:Name="btnGenPage" LargeImageSource="Images/WebRequest_16.png" Label="Page Timings" IsEnabled="False" Click="srGenPage_Click" />
                    <RibbonButton x:Name="btnGenPerfmon" LargeImageSource="Images/WebPerfmon_16.png" Label="Perfmon Timings" IsEnabled="False" Click="srGenPerfmon_Click"/>
                </RibbonGroup>
                <RibbonGroup Header="Results Filter">
                    <RibbonTwoLineText Text="Filter Text:" />
                    <RibbonTextBox x:Name="tbTableFilterString" Text="'%'" TextBoxWidth="125"/>
                </RibbonGroup>
                <RibbonGroup Header="Intervals">
                    <RibbonToggleButton x:Name="btnToggleUseIntervals" Label="Split run into Intervals?" IsChecked="False" ToolTipTitle="Use Intervals to split up the results?" ToolTipDescription="If this button is highlighted, then the results will be split up into intervals, showing the average timing for each interval calculated." Click="srUseIntervals_Click" IsEnabled="False"/>
                    <RibbonComboBox x:Name="cbIntervalColumn" Label="Column to plot for Intervals" IsEnabled="False">
                        <RibbonGallery x:Name="intervalColumnSelectedValue" SelectedValue="Average" SelectedValuePath="Content" MaxColumnCount="1" >
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content="Quantity" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Minimum" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Average" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Maximum" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="90Percent" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="95Percent" HorizontalAlignment="Left" />
                                <RibbonGalleryItem Content="Throughput" HorizontalAlignment="Left" />
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                    <RibbonTextBox x:Name="tbIntervalValue" Label="Interval value (blank for auto) " IsEnabled="False" MinWidth="100"/>
                </RibbonGroup>
            </RibbonTab>
            <RibbonTab Header="Charts" x:Name="RibbonTabCharts" KeyTip="C" IsEnabled="True" Visibility="Hidden">
                <!-- Chart Options Selection Group-->
                <RibbonGroup x:Name="OptionsGroup" Header="Options">
                    <RibbonComboBox x:Name="cbMachines" Width="150" Text="Application Machine 1">
                        <ListBoxItem Content="App Server" IsSelected="True"/>
                        <ListBoxItem Content="SQL Server" IsSelected="True"/>
                    </RibbonComboBox>
                </RibbonGroup>
                <!-- Chart Create  group-->
                <RibbonGroup x:Name="CreateGroup" Header="Create">
                    <RibbonMenuButton x:Name="mbSingleRun" LargeImageSource="Images/Office_Chart_Line_32.png" Label="Single Run" IsEnabled="False" >
                        <!-- This section should be data bound based on the values in the config file-->
                        <RibbonMenuItem x:Name="btnMenuSingleRunCPU" ImageSource="Images/Office_Chart_Line_32.png" Header="CPU" />
                        <RibbonMenuItem ImageSource="Images/Office_Chart_Line_32.png" Header="Available MBytes" />
                        <RibbonMenuItem ImageSource="Images/Office_Chart_Line_32.png" Header="......" />
                    </RibbonMenuButton>
                    <RibbonMenuButton x:Name="mbMultiRun" LargeImageSource="Images/Office_Chart_Line_32.png" Label="Multi-Run Comparison" IsEnabled="False" >
                        <!-- This section should be data bound based on the values in the config file-->
                        <RibbonMenuItem ImageSource="Images/Office_Chart_Line_32.png" Header="Machine xxx CPU" />
                        <RibbonMenuItem ImageSource="Images/Office_Chart_Line_32.png" Header="Machine xxx Available MBytes" />
                        <RibbonMenuItem ImageSource="Images/Office_Chart_Line_32.png" Header="......" />
                    </RibbonMenuButton>
                    <RibbonButton x:Name="TestTheCharting" Label="Test Charting" LargeImageSource="Images/Office_Chart_Combo_32.png" Click="TestTheCharting_Click" />
                    <RibbonButton x:Name="btnSaveChartAsBitmap" Label="Save Chart" LargeImageSource="Images/Office_Chart_Combo_32.png" Click="btnSaveChartAsBitmap_Click" />
                </RibbonGroup>
                <RibbonGroup x:Name="ChartTemplateGroup" Header="Templates" >
                    <RibbonButton x:Name="btnChartLoadTemplate" Label="Load Template" LargeImageSource="Images/Office_Chart_Combo_32.png" Click="btnChartLoadTemplate_Click" />
                    <RibbonButton x:Name="btnChartSaveTemplate" Label="Save Template" LargeImageSource="Images/Office_Chart_Combo_32.png" Click="btnChartSaveTemplate_Click" />
                </RibbonGroup>
            </RibbonTab>
            <RibbonTab Header="Perfmon" x:Name="RibbonTabPerfmon" KeyTip="P" IsEnabled="True">
                <RibbonGroup x:Name="PerfmonGroup" Header="Perfmon Counters">
                    <RibbonButton x:Name="btnPerfmonCountsForRun" Label="Perfmon Counters" LargeImageSource="Images/PerfmonCounts_32.png" Click="btnPerfmonCountsForRun_Click" IsEnabled="False" />
                    <RibbonButton x:Name="btnLoadPerfCounters" Label="Load Perf Counters" LargeImageSource="Images/Perfmon_32.png" Click="btnLoadPerfCounters_Click" IsEnabled="False" />
                    <RibbonButton x:Name="btnImportPerfCounters" Label="Import Perf Counters" LargeImageSource="Images/ImportFromPerfmon_32.png" Click="btnImportPerfCounters_Click" IsEnabled="False" />
                </RibbonGroup>
                <RibbonGroup x:Name="PalGroup" Header="PAL Analysis">
                    <RibbonTwoLineText x:Name="tltPalMachineName" Text="Choose Machine" />
                    <RibbonComboBox x:Name="cbPalMachine" Label="" Height="22" IsEnabled="False" >
                        <RibbonGallery x:Name="cbPalMachineName" SelectedValue="" SelectedValuePath="Content" MaxColumnCount="1" >
                            <RibbonGalleryCategory>
                                <RibbonGalleryItem Content="" HorizontalAlignment="Left" />
                            </RibbonGalleryCategory>
                        </RibbonGallery>
                    </RibbonComboBox>
                    <RibbonTextBox x:Name="tbPalMachineName" TextBoxWidth="150"/>
                    <RibbonButton x:Name="btnExportPerfCounters" Label="Export Perf Counters" LargeImageSource="Images/ExportToPerfmon_32.png" Click="btnExportPerfCounters_Click" IsEnabled="False" />
                    <RibbonButton x:Name="btnRunPal" Label="Run Pal" LargeImageSource="Images/Launch_Pal_32.png" Margin="10,0" IsEnabled="False"/>
                </RibbonGroup>
            </RibbonTab>
        </Ribbon>
        <TabControl x:Name="tcData" Grid.Column="0" Grid.Row="1" Margin="5">
            <TabItem x:Name="tabMainResults" Header="List Of Runs">
                <DataGrid x:Name="dgMainResults" 
					Grid.Row="1" Grid.Column="0" Margin="3" AutoGenerateColumns="True"			 
					SelectionChanged="dgMainResults_SelectionChanged" IsReadOnly="True" />
            </TabItem>
            <TabItem x:Name="tabHelpFileTopics" Header="Help Topics">
                <ListView x:Name="lvHelpTopics" SelectionChanged="lvHelpTopics_SelectionChanged" SelectionMode="Single" >
                    <ListViewItem Content="00 - Getting Started"/>
                    <ListViewItem Content="01 - Editing the DefaultChartingObjects file"/>
                    <ListViewItem Content="01 - Editing the ExtendedSettings file"/>
                    <ListViewItem Content="02 - The Main Screen"/>
                    <ListViewItem Content="02 - The SQL Changes"/>
                    <ListViewItem Content="03 - The OPTIONS ribbon tab"/>
                    <ListViewItem Content="04 - The HOME ribbon tab"/>
                    <ListViewItem Content="05 - The TABLES ribbon tab"/>
                    <ListViewItem Content="06 - The CHARTS ribbon tab"/>
                    <ListViewItem Content="07 - The PERFMON ribbon tab"/>
                    <ListViewItem Content="08 - UPDATE RESULTS DB - Sample output"/>
                    <ListViewItem Content="09 - SUMMARY RESULTS - Sample output"/>
                    <ListViewItem Content="10 - BUILD REPORT - Sample output"/>
                    <ListViewItem Content="11 - SCENARIO-RUN INFO - Sample output"/>
                    <ListViewItem Content="12 - DATABASE INFO - Sample output"/>
                    <ListViewItem Content="TOPIC - Why results may differ between graphs and tables"/>
                    <ListViewItem Content="TOPIC - How Visual Studio calculates and stores results"/>
                    <ListViewItem Content="TOPIC - How Visual Studio handles warmup/cooldown and step load patterns"/>
                </ListView>
                <!--<DataGrid x:Name="dgHelpFileTopics" IsReadOnly="True" SelectionChanged="dgHelpFileTopics_SelectionChanged" >
                </DataGrid>-->
            </TabItem>
            <TabItem x:Name="tabPerfmonTreeView" Header="Performance Counters" Visibility="Hidden">
                <TreeView x:Name="tvPerfmonCounters" TreeViewItem.Expanded="tvPerfmonCounters_Expanded" TreeViewItem.Selected="tvPerfmonCounters_Selected"/>
            </TabItem>
        </TabControl>
        <GridSplitter x:Name="_gridSplitter" Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Center" Width="6" Background="Gold"/>
        <TabControl x:Name="tcDisplay" Grid.Column="2" Grid.Row="1" Margin="5">
            <TabItem x:Name="tabRichTextBox" Header="Reporting Info">
                <Grid>
                    <Grid.Resources>
                        <Style TargetType="{x:Type Button}" x:Key="formatTextStyle">
                            <Setter Property="FontFamily" Value="Palatino Linotype"/>
                            <Setter Property="Width" Value="30"/>
                            <Setter Property="FontSize" Value ="14"/>
                            <Setter Property="CommandTarget" Value="{Binding ElementName=rtbResults}"/>
                        </Style>
                        <Style TargetType="{x:Type Button}" x:Key="formatImageStyle">
                            <Setter Property="Width" Value="30"/>
                            <Setter Property="CommandTarget" Value="{Binding ElementName=rtbResults}"/>
                        </Style>
                        <DataTemplate x:Key="FontTemplate">
                            <TextBlock Text="{Binding Source}" ToolTip="{Binding Source}" />
                        </DataTemplate>
                        <CollectionViewSource x:Key="myFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
                            <CollectionViewSource.SortDescriptions>
                                <ComponentModel:SortDescription PropertyName="Source" />
                            </CollectionViewSource.SortDescriptions>
                        </CollectionViewSource>
                        <!--<CollectionViewSource x:Key="myFontSizes" Source="{Binding Source={x:Static Fonts.}}" />-->
                    </Grid.Resources>
                    <DockPanel x:Name="mainPanel">
                        <!-- This tool bar contains all the editing buttons. -->
                        <ToolBar x:Name="rtbEditingToolBar" Height="30" DockPanel.Dock="Top" Visibility="Visible">
                            <ComboBox x:Name="cbFontStyle" ItemTemplate="{DynamicResource FontTemplate}" Width="180" SelectionChanged="cbFontStyle_SelectionChanged" ItemsSource="{Binding Source={StaticResource myFonts}}"/>
                            <ComboBox Grid.Row="1" Grid.Column="0" Margin="5" Width="50" SelectedIndex="4">
                                <ComboBoxItem Content="8"/>
                                <ComboBoxItem Content="9"/>
                                <ComboBoxItem Content="10"/>
                                <ComboBoxItem Content="11"/>
                                <ComboBoxItem Content="12"/>
                                <ComboBoxItem Content="14"/>
                                <ComboBoxItem Content="16"/>
                                <ComboBoxItem Content="18"/>
                                <ComboBoxItem Content="20"/>
                                <ComboBoxItem Content="22"/>
                                <ComboBoxItem Content="24"/>
                                <ComboBoxItem Content="26"/>
                                <ComboBoxItem Content="28"/>
                                <ComboBoxItem Content="36"/>
                                <ComboBoxItem Content="48"/>
                                <ComboBoxItem Content="72"/>
                            </ComboBox>
                            <Separator Margin="10,0,10,0"/>
                            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleBold" ToolTip="Bold">
                                <TextBlock FontWeight="Bold"><Run Text="B"/></TextBlock>
                            </Button>
                            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleItalic" ToolTip="Italic">
                                <TextBlock FontStyle="Italic" FontWeight="Bold"><Run Text="I"/></TextBlock>
                            </Button>
                            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleUnderline" ToolTip="Underline">
                                <TextBlock TextDecorations="Underline" FontWeight="Bold"><Run Text="U"/></TextBlock>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseFontSize" ToolTip="Grow Font">
                                <Image Source="Images/FontLarger_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseFontSize" ToolTip="Shrink Font">
                                <Image Source="Images/FontSmaller_16.png"/>
                            </Button>
                            <Separator Margin="10,0,10,0"/>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignLeft" ToolTip="Align Left">
                                <Image Source="Images/ParagraphAlignLeft_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignCenter" ToolTip="Align Center">
                                <Image Source="Images/ParagraphAlignCenter_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignRight" ToolTip="Align Right">
                                <Image Source="Images/ParagraphAlignRight_16.png"/>
                            </Button>
                            <Separator Margin="10,0,10,0"/>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleBullets" ToolTip="Bullets">
                                <Image Source="Images/ParagraphBullet_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleNumbering" ToolTip="Numbering">
                                <Image Source="Images/ParagraphBulletNumbered_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseIndentation" ToolTip="Increase Indent">
                                <Image Source="Images/ParagraphIncreaseIndent_16.png"/>
                            </Button>
                            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseIndentation" ToolTip="Decrease Indent">
                                <Image Source="Images/ParagraphDecreaseIndent_16.png"/>
                            </Button>

                        </ToolBar>
                        <!-- By default pressing tab moves focus to the next control. Setting AcceptsTab to true allows the RichTextBox to accept tab characters. -->
                        <RichTextBox x:Name="rtbResults" AcceptsTab="True" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
                    </DockPanel>
                </Grid>
            </TabItem>
            <TabItem x:Name="tabDataGrid" Header="Tables" SourceUpdated="DataGridTab_SourceUpdated">
                <DataGrid x:Name="dgRunResults" AutoGenerateColumns="True" IsReadOnly="True" AlternatingRowBackground="#FFC0FFFF" 
					AlternationCount="1" FontFamily="Arial">
                    <DataGrid.CellStyle>
                        <Style>
                            <Style.Triggers>
                                <Trigger Property="DataGridCell.IsSelected" Value="True">
                                    <Setter Property="DataGridCell.Background" Value="SteelBlue" />
                                    <Setter Property="DataGridCell.BorderBrush" Value="GreenYellow" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGrid.CellStyle>
                </DataGrid>
            </TabItem>
            <TabItem x:Name="tabChartControl" Header="Charts" Height="22" VerticalAlignment="Top">
                <Grid>
                    <DockPanel Grid.Row="0">
                        <WindowsFormsHost DockPanel.Dock="Top">
                            <winformchart:Chart x:Name="MyWinformChart" Dock="Top">
                                <winformchart:Chart.ChartAreas>
                                    <winformchart:ChartArea/>
                                </winformchart:Chart.ChartAreas>
                            </winformchart:Chart>
                        </WindowsFormsHost>
                    </DockPanel>
                </Grid>
            </TabItem>
            <TabItem x:Name="tabConfiguration" Header="Configuration" Visibility="Visible">
                <xctk:PropertyGrid x:Name="ApplicationSettingsPropertyGrid" SelectedObject="{Binding}" NameColumnWidth="250" >
                    <xctk:PropertyGrid.DataContext>
                        <local:AppConfiguration />
                    </xctk:PropertyGrid.DataContext>
                </xctk:PropertyGrid>
            </TabItem>
            <TabItem x:Name="tabListOfRunsValidation" Header="LoadTestCoreInfo Object (for debugging)" Visibility="Hidden">
                <xctk:PropertyGrid x:Name="ObjectValidationPropertyGrid" SelectedObject="{Binding}" NameColumnWidth="250" >
                    <xctk:PropertyGrid.DataContext>
                        <ReportingEngine:LoadTestCoreInfo/>
                    </xctk:PropertyGrid.DataContext>
                </xctk:PropertyGrid>
            </TabItem>
            <TabItem x:Name="tabChartStyleProperties" Header="Chart Format Properties" Visibility="Hidden">
                <xctk:PropertyGrid x:Name="ChartPropertyGrid" SelectedObject="{Binding}" NameColumnWidth="250" >
                    <xctk:PropertyGrid.DataContext>
                        <winformchart:ChartArea/>
                    </xctk:PropertyGrid.DataContext>
                </xctk:PropertyGrid>
            </TabItem>
            <TabItem x:Name="tabScrollViewer" Header="viewer">
                <WebBrowser x:Name="wbResults"></WebBrowser>
            </TabItem>
        </TabControl>
        <StatusBar Height="25" VerticalAlignment="Bottom" Grid.Row="2" Grid.ColumnSpan="3">
            <StatusBarItem x:Name="sbiMessageItem">
                <Label x:Name="tsslMessage" Padding="10,0,10,0" Content="This space for rent." MinWidth="500"/>
            </StatusBarItem>
            <Separator Margin="10,2,10,2" />
            <StatusBarItem x:Name="sbiProgressBar">
                <!--<ProgressBar Width="100" Height="15"
					x:Name="progressBar1">
                    <ProgressBar.Triggers>
                        <EventTrigger RoutedEvent="ProgressBar.Loaded">
                            <BeginStoryboard>
                                <Storyboard>
                                    <DoubleAnimation
                Storyboard.TargetName="progressBar1" 
                Storyboard.TargetProperty="Value"
                From="0" To="100" Duration="0:0:5"  />
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </ProgressBar.Triggers>
                </ProgressBar>-->
            </StatusBarItem>
            <StatusBarItem x:Name="sbiFlagsText">
                <TextBlock x:Name="tsslFlags" Text="Flags:" Margin="10,0" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the test run was aborted. Results may not be complete.">
                <Image x:Name="tsslTestAborted" Source="Images/Warning_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run contains web page results">
                <Image x:Name="tsslHasPageResults" Source="Images/WebRequest_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run contains transaction timer results">
                <Image x:Name="tsslHasTransactionResults" Source="Images/WebTransaction_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run contains detailed timing results">
                <Image x:Name="tsslHasTimingResults" Source="Images/LoadTestTimingDetails_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run contains user load values (usually because of a Step Load pattern)">
                <Image x:Name="tsslHasStepLoad" Source="Images/StepLoad_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run was executed locally">
                <Image x:Name="tsslIsLocalRun" Source="Images/computersystemproduct.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run contains text in the 'Analysis Notes' field.">
                <Image x:Name="tsslHasAnalysisNotes" Source="Images/AnalysisNotes_16.png" Opacity="0.3" />
            </StatusBarItem>
            <StatusBarItem ToolTip="indicates that the highlighted run's LoadTest field failed to parse properly">
                <Image x:Name="tsslLoadTestFailed" Source="Images/XML_File_16.png" Opacity="0.3" />
            </StatusBarItem>
            <Separator Margin="10,2,10,2" />
            <StatusBarItem x:Name="sbiAppVersionText">
                <Label x:Name="tsslEngineVersion" Padding="10,0,10,0" Content="Reporting Engine Version" />
            </StatusBarItem>
            <Separator Margin="10,2,10,2" />
            <StatusBarItem x:Name="sbiDebugText">
                <TextBlock x:Name="tsslDebug" Text="Debug Stuff:" Margin="10,0" />
            </StatusBarItem>
            <StatusBarItem x:Name="sbiQueryDebug">
                <Image x:Name="btnQueryDebug" Source="Images/Query_16.png" ToolTip="Copies the most recently executed SQL Query to the clipboard for debugging purposes" MouseUp="btnQueryDebug_MouseUp" />
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
